﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace PLCS.App.OrderTask.Convert;

internal class PermitConvert : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        const string allow = "已放行";
        const string waiting = "等待放行";

        return value?.ToString().Equals("True", StringComparison.OrdinalIgnoreCase) == true ? allow : waiting;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return null;
    }
}